package com.chenyu.controller;

import com.chenyu.service.UserService;
import com.chenyu.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.LinkedHashMap;
import java.util.List;

@RestController
public class indexController {
    @Autowired
    private UserService userService;
    @RequestMapping(path = {"/test"})
    public Result Test(){
        List<LinkedHashMap<String, Object>> linkedHashMaps = null;
        try{
            linkedHashMaps = userService.selectAll();
            return new Result("succeed",true,linkedHashMaps);
        }catch (Exception ex){
            ex.printStackTrace();
            return new Result("error",false);
        }
    }
}
